﻿<%@ Page Title="" Language="C#" MasterPageFile="~/DeveloperSite.Master" AutoEventWireup="true" 
    CodeBehind="Cpd_Output_Indicators.aspx.cs" Inherits="UNDP_Projects.CO.Cpd_Output_Indicators" 
    MaintainScrollPositionOnPostback="true" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <asp:EntityDataSource ID="EntityDataSource1" runat="server" 
        ConnectionString="name=UNDPEntities" DefaultContainerName="UNDPEntities" 
        EnableFlattening="False" EntitySetName="cpd_output_indicators" 
        EnableDelete="True" EnableInsert="True" EnableUpdate="True">
    </asp:EntityDataSource>

    <div style="height:2em;">
        <div style="float:left;">
            <asp:Label ID="ContextLabel" runat="server" Text="CPD OUTPUT INDICATORS" CssClass="ContentHead"></asp:Label>
        </div>
        <% if (User.IsInRole("Administrator"))
           { %>
            <div style="float:right;">
                <asp:Button ID="AddCPDOutputIndicatorButton" runat="server" Text="Add Indicator" 
                    OnClick="AddCPDOutputIndicatorButton_Click" />
            </div>
        <% } %>
    </div>

    <% if (User.IsInRole("Administrator"))
       { %>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataSourceID="EntityDataSource1" CssClass="NewGrid" ShowFooter="True" 
            AllowSorting="True" 
        DataKeyNames="cpd_output_indicator_id,cpd_output_id">
            <AlternatingRowStyle CssClass="NewGridAlt" />
            <Columns>
                <asp:CheckBoxField DataField="gender_marker" HeaderText="Gender Marker" 
                    SortExpression="gender_marker" >
                    <HeaderStyle ForeColor="White"></HeaderStyle>
                </asp:CheckBoxField>
                <asp:CheckBoxField DataField="hiv_marker" HeaderText="HIV Marker" 
                    SortExpression="hiv_marker" >
                    <HeaderStyle ForeColor="White"></HeaderStyle>
                </asp:CheckBoxField>
                <asp:BoundField DataField="cpd_output_indicator_id" 
                    HeaderText="INDICATOR" SortExpression="cpd_output_indicator_id">
                <HeaderStyle ForeColor="White"></HeaderStyle>
                </asp:BoundField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" 
                            Text='<%# Bind("cpd_output_indicator_question") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Width="60em" Height="3em" TextMode="MultiLine" 
                            CssClass="MText" 
                            Text='<%# Bind("cpd_output_indicator_question") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemStyle HorizontalAlign="Left" />
                </asp:TemplateField>

                <asp:CommandField ShowEditButton="true" ButtonType="Button" HeaderText="EDIT" />
                <asp:CommandField ShowDeleteButton="true" ButtonType="Button" HeaderText="DELETE" />

                

            </Columns>
            <FooterStyle CssClass="NewGridFooter" />
        </asp:GridView>
    <% }
       else
       { %>
       <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
        DataSourceID="EntityDataSource1" CssClass="NewGrid" ShowFooter="True" 
        AllowSorting="true" DataKeyNames="cpd_output_indicator_id, cpd_output_id">
        <AlternatingRowStyle CssClass="NewGridAlt" />
        <Columns>
                <asp:CheckBoxField DataField="gender_marker" HeaderText="Gender Marker" 
                    SortExpression="gender_marker" >
                    <HeaderStyle ForeColor="White"></HeaderStyle>
                </asp:CheckBoxField>
                <asp:CheckBoxField DataField="hiv_marker" HeaderText="HIV Marker" 
                    SortExpression="hiv_marker" >
                    <HeaderStyle ForeColor="White"></HeaderStyle>
                </asp:CheckBoxField>
            <asp:BoundField DataField="cpd_output_indicator_id" 
                HeaderText="INDICATOR" SortExpression="cpd_output_indicator_id">
            <HeaderStyle ForeColor="White"></HeaderStyle>
            </asp:BoundField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" 
                        Text='<%# Bind("cpd_output_indicator_question") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Width="60em" Height="3em" TextMode="MultiLine" 
                        CssClass="MText" 
                        Text='<%# Bind("cpd_output_indicator_question") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemStyle HorizontalAlign="Left" />
            </asp:TemplateField>
        </Columns>
        <FooterStyle CssClass="NewGridFooter" />
    </asp:GridView>
    <% } %>

</asp:Content>
